package com.juli.aimanager.util;
/**
 * 版本号转INT
 * @author 小帅丶
 * @类名称  SoftUtil
 * @remark 
 * @date  2017-8-10
 */
public class SoftUtil {
	public static void main(String[] args) {
		System.out.println("1.48".compareTo("01.48"));
	}
	/**
	 * @param softVersion
	 * @return int版本号
	 */
	public static Integer getInteger(String softVersion){
		if(softVersion.length()<=5){
			if(softVersion.startsWith("0")&&softVersion.indexOf(".")==2){
				softVersion = softVersion.substring(1, softVersion.length());
				Double double1 = Double.parseDouble(softVersion)*100;
				Integer integer = double1.intValue();
				return integer;
			}else{
				Double double1 = Double.parseDouble(softVersion)*100;
				Integer integer = double1.intValue();
				return integer;
			}
		}else{
			if(softVersion.startsWith("0")&&softVersion.indexOf(".")==1){
				softVersion = softVersion.substring(2, softVersion.length());
				Integer integer = Integer.parseInt(softVersion);
				return integer;
			}else{
				Double double1 = Double.parseDouble(softVersion)*100;
				Integer integer = double1.intValue();
				return integer;
			}
		} 
	}
}
